<template>
	<view class="container">
		<!-- header头部 -->
		<view class="header">
			<view class="banner">
				<image src="@/static/banner.png" mode="aspectFit"></image>
			</view>
			<view class="ban-nav">
				<view class="ban-item" @tap="gotoTest()">
					<image src="@/static/hua1.svg" mode="aspectFit"></image>
					<view class="ban-text">
						花卉百科
					</view>
				</view>
				<view class="ban-item"  @tap="gotoLogin()">
					<image src="@/static/hua2.svg" mode="aspectFit"></image>
					<view class="ban-text">
						养护指南
					</view>
				</view>
				<view class="ban-item" @tap="showpause">
					<image style="width: 50rpx;height: 54rpx;" src="@/static/hua3.svg" mode="aspectFit"></image>
					<view class="ban-text">
						花园设计
					</view>
				</view>
				<view class="ban-item">
					<image src="@/static/hua4.svg" mode="aspectFit"></image>
					<view class="ban-text">
						社区互动
					</view>
				</view>
			</view>
		</view>
		
		<!-- tips -->
		<view class="c-tips">
			<view class="c-t-title">
				<image style="width: 55rpx;height: 40rpx;" src="@/static/flow2.svg" mode=""></image>
				<view class="">
					今日花语
				</view>
			</view>
			<view class="c-t-more">
					查看更多
			</view>
		</view>
		<!--center部分——今日花语  -->
		<view class="center">
			<view class="center-item" @tap="gotoDetail()">
			<view class="c-imgcon">
				<image src="@/static/sunflower.jpg" mode="aspectFill"></image>
			</view>
			<view class="c-flower">
				<view class="f-name">
					向日葵
				</view>
				<view class="f-jianjie">
					始终追随太阳，代表积极向上的生命力和永久的喜欢和
				</view>
				<view class="f-sense">
					忠诚、阳光与希望
				</view>
			</view>
			</view>
		<view class="center-item">
		<view class="c-imgcon">
			<image src="@/static/rose.jpg" mode="aspectFill"></image>
		</view>
		<view class="c-flower">
			<view class="f-name">
				玫瑰
			</view>
			<view class="f-jianjie">
				世界最著名的花卉，红玫瑰象征炽热爱意
			</view>
			<view class="f-sense">
				爱情（红）、纯洁（白）
			</view>
		</view>
		</view>
		
		<view class="center-item">
		<view class="c-imgcon">
			<image src="@/static/rose.jpg" mode="aspectFill"></image>
		</view>
		<view class="c-flower">
			<view class="f-name">
				玫瑰
			</view>
			<view class="f-jianjie">
				世界最著名的花卉，红玫瑰象征炽热爱意
			</view>
			<view class="f-sense">
				爱情（红）、纯洁（白）
			</view>
		</view>
		</view>
		
			<view class="center-item">
				
			</view>
		</view>
		
		
		<!-- tips -->
		<view class="c-tips" style="margin-top: 25rpx;">
			<view  class="c-t-title">
				<image style="width: 55rpx;height: 40rpx;" src="@/static/hua3.svg" mode=""></image>
				<view class="">
					养护指南
				</view>
			</view>
			<view class="c-t-more">
				查看更多
			</view>
		</view>
		
		
		<!-- 养护指南 -->
		<view class="protect_method">
			<view class="pro-left">
				<view class="pro_title">
					黄叶危机诊断手册 | 植物急诊科必修课·5大诱因全解析纷纷热热321
				</view>
				<view class="pro_study">
					140人正在学习
				</view>
				<view class="pro_hot">
					热门
				</view>
			</view>
			<view class="pro-right">
				<image src="@/static/wine-leaf-56053_1280.jpg" mode=""></image>
			</view>
		</view>
		
	<view class="protect_method">
		<view class="pro-left">
			<view class="pro_title">
				多肉植物「隐性水黄症」全周期干
				预方案——从徒长到化水的拯救实录
			</view>
			<view class="pro_study">
				220人正在学习
			</view>
			<view class="pro_hot">
				热门
			</view>
		</view>
		<view class="pro-right">
			<image src="@/static/duorou207828_1280.jpg" mode=""></image>
		</view>
	</view>
		
		
		<!-- tips -->
		<view class="c-tips" style="margin-top: 25rpx;">
			<view  class="c-t-title">
				<image style="width: 55rpx;height: 40rpx;" src="@/static/hua3.svg" mode=""></image>
				<view class="">
					问答社区
				</view>
			</view>
			<view class="c-t-more">
				查看更多
			</view>
		</view>
		
		
		<view class="community-con">
			<view class="community">
				
			</view>
		</view>
		
		
		
	</view>
</template>

<script setup>
import {ref} from 'vue'

const showpause = () =>{
	uni.showToast({
		icon:'none',
		title:"该功能暂未开放"
	})
}

const gotoDetail = () =>{
	uni.navigateTo({
		url:'/pages/flowdetail/flowdetail'
	})
}

const gotoTest = () =>{
	uni.navigateTo({
		url:'/pages/test/test'
	})
}

const gotoLogin = ()=>{
	uni.navigateTo({
		url:'/pages/login/login'
	})
}

</script>

<style lang="scss">
	.container {
		padding: 0;
		margin: 0;
		box-sizing: border-box;
		//头部
		.header{
			padding: 0;
			margin: 0;
			height: 510rpx;
			width: 750rpx;
			// background-color: pink;
		    position: relative;
			.banner{
				width: 750rpx;
				height: 330rpx;
				// background-color: skyblue;
				image {
					width: 100%;
					height: 100%;
				}
			}
			.ban-nav{
				position: absolute;
				bottom: 20rpx;
				left: 25rpx;
				width: 702rpx;
				height: 196rpx;
				border-radius: 10px;
				background-color: #fff;
				box-shadow: 0 0 40 0;
				display: flex;
				align-items: center;
				justify-content: space-around;

				.ban-item{
					width: 120rpx;
					height: 150rpx;
					// background-color: skyblue;
					font-size: 30rpx;
					color: #333333;
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
					image{
						height: 66rpx;
						width: 50rpx;
					}
					.ban-text{
						margin-top: 10rpx;
					}
				}
				
				
			}
		}
		
		.c-tips{
			width: 750rpx;
			height: 75rpx;
			box-sizing: border-box;
			// background-color: skyblue;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 20rpx;
			.c-t-title{
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 32rpx;
				color: #333333;
				image{
					margin-right: 5rpx;
				}
			}
			.c-t-more{
				color: #999;
				font-size: 24rpx
				
			}
		}
		
		//今日花语
		.center{
			width: 750rpx;
			height: 450rpx;
			// background-color: skyblue;
			display: flex;
		    align-items: center;
		    flex-wrap: nowrap; /* 禁止换行 */
		    overflow-x: auto;  /* 水平滚动 */
		    -webkit-overflow-scrolling: touch; /* 启用弹性滚动 */
		   &::-webkit-scrollbar {
		     display: none;
		   }
			
			.center-item{
				width: 320rpx;
				height: 418rpx;
				background-color: pink;
				flex-shrink: 0; /* 禁止项目缩放 */
				margin: 0 10rpx;
				border-radius: 10rpx;
				background-color: #fff;
				box-shadow: 0 0 40 0;
				.c-imgcon{
					width: 100%;
					height: 210rpx;
					margin-top: 15rpx;
					display: flex;
					justify-content: center;
					image{
						width: 280rpx;
						height: 200rpx;
						border-radius: 10rpx;
					
					
					}
				}
				.c-flower{
					padding: 0 10rpx;
					.f-name{
						font-size: 30rpx;
						color: #A5D63F;
					}
					.f-jianjie{
						font-size: 25rpx;
						color: #333333;
						margin-top: 5rpx;
						display: -webkit-box;
						-webkit-line-clamp: 2; 
					    overflow: hidden; 
						-webkit-box-orient: vertical; 
						text-overflow: ellipsis;
						text-indent: 2em;  
						
					}
					.f-sense{
						margin-top: 15rpx;
						font-size: 24rpx;
						color: #0BAC6A;
					}
				}
		
			}
		}
		
		
		//养护指南
		.protect_method{
			box-sizing: border-box;
			border-radius: 10rpx;
			box-shadow: 0 0 40 0;
			width: 702rpx;height: 224rpx;
			margin: 0 auto;
			background-color:#fff;
			margin-top: 20rpx;
			display: flex;
			justify-content: space-between;
		    align-items: center;
			padding: 0 15rpx;
			.pro-left{
				box-sizing: border-box;
				padding: 10rpx;
				
				width: 400rpx;
				height: 100%;
				// background-color: skyblue;
				.pro_title{
					margin-top: 15rpx;
					color: #333333;
					font-size: 26rpx;
					display: -webkit-box;
					-webkit-line-clamp: 2; 
					overflow: hidden; 
					-webkit-box-orient: vertical; 
					text-overflow: ellipsis;
				
					
				}
				.pro_study{
					margin-top: 20rpx;
					color: #999;
					font-size: 24rpx;
				}
				.pro_hot{
					margin-top: 15rpx;
					color: #0BAC6A;
					font-size: 26rpx;
				}
				
			}
			.pro-right{
				width: 240rpx;
				height: 192rpx;
				background-color: pink;
				image{
					width: 100%;
					height: 100%;
					border-radius: 10rpx;
				}
				
			}
		}
		
		
		
		// 问答社区
		.community-con{
			box-sizing: border-box;
			width: 750rpx;
			height: 580rpx;
			display: flex;
			// background-color: skyblue;
			justify-content: center;
			margin-top: 20rpx;
			.community{
				box-sizing: border-box;
				border-radius: 10rpx;
				width: 705rpx;
				height: 508rpx;
				background-color: #fff;
				box-sizing: 0 0 40 0;
			}
		}
	
	}
</style>
